﻿using System.IO;
using Newtonsoft.Json.Linq;
using SpriteAtlasRuntime;

namespace AnimationPackerEngine.Animation.CommandWriters
{
    internal class Jump : ICommandWriter
    {
        private string mScript;

        internal Jump(JValue value)
        {
            mScript = value.Value as string;
        }

        public void Write(BinaryWriter binaryWriter, IWriterContext context)
        {
            binaryWriter.Write((int)ScriptCommands.Jump);
            binaryWriter.Write(context.ScriptIndex(mScript));
        }
    }
}
